package defectsim.agents;

public class DefectFactory {
	
	public enum DefectType {
		EdgeDislocation,
		ScrewDislocation,
		DislocationSource,
		Obstacle,
		PointDefect
	}

	public static DefectAgent createDefect(DefectType defectType) {
		switch (defectType) {
		case EdgeDislocation:
			return new EdgeDislocation();
		case ScrewDislocation:
			return new ScrewDislocation();
		case DislocationSource:
			return new DislocationSource();
		case PointDefect:
			return new PointDefect();
		}
		throw new IllegalArgumentException("The defect type " + defectType + " is not recognized.");
	}
}
